bitkeeper revision 1.1041.6.3 (40e532ebjteJL-J2vKsGbaORF1GYvw)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Fri, 2 Jul 2004 10:03:23 +0000 (10:03 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Fri, 2 Jul 2004 10:03:23 +0000 (10:03 +0000)
Better bad-cpu error report.

xen/arch/x86/boot/x86_32.S

index ae1d72ad23dab69e080b98b4dc5d407f762666fb..fea54c1336df00ff25a4b3c901f976de9259c6ad 100644 (file)
@@ -19,8 +19,25 @@ ENTRY(start)
        /* Checksum: must be the negated sum of the first two fields. */
        .long   -0x1BADB004
         
+bad_cpu_msg:
+        .asciz "Bad CPU: we need at least a P6-compatible core."
 bad_cpu:
-        jmp     bad_cpu
+        mov     $SYMBOL_NAME(bad_cpu_msg)-__PAGE_OFFSET,%esi
+        mov     $0xB8000,%edi  # VGA framebuffer
+1:      mov     (%esi),%bl
+        test    %bl,%bl        # Terminate on '\0' sentinel
+2:      je      2b
+        mov     $0x3f8+5,%dx   # UART Line Status Register
+3:      in      %dx,%al
+        test    $0x20,%al      # Test THR Empty flag
+        je      3b
+        mov     $0x3f8+0,%dx   # UART Transmit Holding Register
+        mov     %bl,%al
+        out     %al,%dx        # Send a character over the serial line
+        movsb                  # Write a character to the VGA framebuffer
+        mov     $7,%al
+        stosb                  # Write an attribute to the VGA framebuffer
+        jmp     1b
         
 __start:
         /* Set up a few descriptors: on entry only CS is guaranteed good. */